<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLotteryRecordsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('lottery_records', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('lottery_id')->index()->comment('活动ID');
            $table->bigInteger('user_id')->index()->comment('用户ID');
            $table->bigInteger('award_id')->index()->comment('奖品ID');
            $table->string('status', 16)->default(\App\Enums\LotteryRecordStatus::WAITING)->comment('状态');
            $table->text('remark')->nullable()->comment('备注信息');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('lottery_records');
    }
}
